package com.lanxin.oa.zu.service.serviceImpl;

import com.lanxin.bean.MpCardtype;
import com.lanxin.bean.MpContact;
import com.lanxin.bean.ZcAssettype;
import com.lanxin.oa.zu.dao.ZuDao;
import com.lanxin.oa.zu.service.ZuService;
import com.lanxin.util.PageBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Service
public class ZuServiceImpl implements ZuService {
    @Autowired
    ZuDao dao;
    @Override
    public PageBean selectzu(Integer page,Integer pageSize,String type) {
        return dao.selectzu(page,pageSize,type);
    }



    @Override
    public MpCardtype selectzuByid(Integer oid) {
        return  dao.selectzuByid(oid);
    }

    @Override
    public void insertzu(MpCardtype zu) {
       dao.add(zu);
    }

    @Override
    public boolean selectByzutype(String type, Integer oid) {
        MpCardtype zu=dao.selectzuBytype(type,oid);
        if(zu!=null){
            return true;
        }
        return false;
    }

    @Override
    public void updatezu(MpCardtype zu) {
        dao.update(zu);
    }

    @Override
    public boolean deletezu(MpCardtype zu) {
        MpContact z=dao.selectmp(zu.getOid());
        if (z!= null ) {
            return false;
        }
        dao.delete(zu);
        return  true;
    }




}
